<%@ page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"
	language="java" session="true"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page import="java.util.List"%>
<%@ page import="sri.proiect.controllers.*"%>
<%@ page import="sri.proiect.search.*"%>
<%@ page import="sri.proiect.models.*"%>


<% List<Hotel> hotels = (List<Hotel>)session.getAttribute("hotels");%>
<table cellpadding="0" cellspacing="0" width="100%" border="0"
	align="left" background="#fff url(images/bg_main.png) 50% 0 repeat-y">
	<%
 	int index = Integer.parseInt(request.getParameter("index"));
	Hotel hotel = (Hotel)hotels.get(index);
	int hits = hotel.getHits()+1;
	
 %>
	<tr>
		<td>
		<table class='unitate'>

			<td valign='top' width='124'>
			<table border=0 cellspacing=3 cellpadding=3 width='100%'>
			</table>
			</td>
			<td valign='top' align='left'>
			<table border=0 cellspacing=3 cellpadding=3 width='100%'
				align='center'>
				<tr>
					<td valign='top' align='left'>
					<%if (hotel.getWebsite() != null) {%>
					<a href='<%=hotel.getWebsite() %>'>
					<%} else { %>
					<a href='<%=hotel.getLink() %>'>
					<%} %>
					<b>
					<font color='#BB0000'><%=hotel.getNume()%> </font></b></a>&nbsp;<br>
				</tr>
				<tr>
					<td colspan='2' align='left'>Numar stele: <%=hotel.getNrStele() %></td>
				</tr>
				<tr>
					<td colspan='2' align='left'>Detalii: <%=hotel.getShortDescription() %></td>
				</tr>
				<tr>
					<td colspan='2' align='left'>Adresa: <%=hotel.getAdresa() %></td>
				</tr>
				<tr>
					<td colspan='2' align='left'>Oras: <%=hotel.getOras() %></td>
				</tr>
				<tr>
					<td colspan='2' align='left'>Judet: <%=hotel.getJudet() %></td>
				</tr>
				<tr>
					<td colspan='2' align='left'>Telefon: <%=hotel.getTelefon() %></td>
				</tr>
				<tr>
					<td colspan='2' align='left'>E-mail: <%=hotel.getEmail() %></td>
				</tr>
				<tr>
					<td colspan='2' align='left'>Link: <%=hotel.getLink() %></td>
				</tr>
			</table>
			</td>
		</table>
		<br>
		</td>
	</tr>
	<tr>
		<td>
		<div id="map_canvas" style="width:400px; height:300px;" align="center">
  			<div style="padding:1em; color:gray;">Loading...</div>
		</div>
		<hr width=100% />
		</td>
	</tr>
</table>


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
    
     <script src="http://maps.google.com/maps?file=api&amp;v=2.73&amp;key=ABQIAAAA-O3c-Om9OcvXMOJXreXHAxSsTL4WIgxhMZ0ZK_kHjwHeQuOD4xSbZqVZW2U_OWOxMp3YPfzZl2GavQ"
      type="text/javascript"></script>
     <script type="text/javascript"><!--

    	var geocoder = new GClientGeocoder();

		function showAddress(map , address,point, pname, hrefs) {
               geocoder.getLatLng(
                   address,
                       function(point) { 
                             if (point){ 
                                      map.addOverlay(createMarker(map, point, pname, address, hrefs)); 
 								     map.setCenter(point, 10);              
                                     } 
                       }  
                );  
   			}   
 
 
	// Creates a marker at the given point with the given number label 
	function createMarker(map , point, pname, address, hrefs) { 
	  var marker = new GMarker(point); 
	  GEvent.addListener(marker, "click", function() { 
	    marker.openInfoWindowHtml(
	        "<center style='color: #000000; font-weight: bold; font-size: 1.0em '>" + pname +
	        "<br/><p style='font-weight: normal; font-size: 0.8em'>"+address+"<br/>"+hrefs+"</p>");  
	  }); 
	  return marker; 
	}

     jQuery(function() {
	
       if (GBrowserIsCompatible()) {
         var map = new GMap2(document.getElementById('map_canvas'));
      	map.addControl(new GSmallMapControl());
//START IMPORTANT
		//daca se stie adresa se foloseste
		var point = null;
		point = showAddress(map , "<%=hotel.getAdresa()%>",point, "pname", "http://koko.com");

       }
    });
    //--></script>

<a href='SearchController?searchWord='><b><font color='#BB0000'>Inapoi</font></b></a>&nbsp;<br>
